package com.skyward.android.androiddemo2.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by skyward on 2017/3/15.
 * email:
 */

public class NewsFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        String title = getArguments().getString("title");
        TextView textView = new TextView(getActivity());
        textView.setText(title);

        return textView;

    }

    public static NewsFragment getInstance(String title){
        NewsFragment newsFragment = new NewsFragment();
        Bundle bundle = new Bundle();
        bundle.putString("title",title);
        newsFragment.setArguments(bundle);
        return newsFragment;
    }
}
